package com.ea.eadp.nexus.test.workflow.newconsole.parentemail;

import org.openqa.selenium.WebDriver;
import org.testng.Assert;

import com.ea.eadp.nexus.test.pageDefinition.newconsole.VerifyParentEmailPage;
import com.ea.eadp.nexus.test.workflow.WorkflowElement;
import com.ea.eadp.nexus.test.workflow.WorkflowElementArgument;

public abstract class ParentEmailChallengeWorkflowElement
extends WorkflowElement {
    
    protected VerifyParentEmailPage page;
    
    public boolean hasSkipButton = true;
    
    public ParentEmailChallengeWorkflowElement(
        WebDriver driver, WorkflowElementArgument argument
    ) {
        super(driver, argument);
        page = new VerifyParentEmailPage(driver);
    }
    
    @Override
    public void init() {
        page.waitPageLoadCompleted();
    }
    
    @Override
    public void doPreVerification() {
        Assert.assertEquals(
            page.getElementString(VerifyParentEmailPage.txt_parentEmailAddress),
            args.parentEmail,
            "Parent email wrong"
        );
        Assert.assertEquals(
            page.hasSkipButton(), hasSkipButton, "Skip button visibility Wrong"
        );
    }
    
}
